package com.hnevc.androiduiclassone3;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.RadioGroup;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.contrcl_layout);
        RadioGroup radioGroup=findViewById(R.id.rg_sex);
        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                Log.e(TAG, "onCheckedChanged: "+checkedId);
                switch (checkedId){
                    case R.id.rg_male:
                        Log.e(TAG, "onCheckedChanged: "+"男" );
                    case R.id.rg_female:
                            Log.e(TAG, "onCheckedChanged: "+"女");
                }
            }
        });
    }

    public void login(View view) {
        Log.e(TAG, "login: ");
        Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show();
    }


}
